Python in Education by Nicholas H. Tollervey
Author:Nicholas H. Tollervey
Language: eng
Format: mobi, epub, pdf
Publisher: O'Reilly Media, Inc.
Published: 2015-03-16T04:00:00+00:00
Chapter 3. Why Python in Education?
I am going to answer a very simple question: which features of the Python language itself make it appropriate for education? This will involve learning a little Python and reading some code. But don’t worry if you’re not a coder! This chapter will hopefully open your eyes to how easy it is to learn Python (and thus, why it is such a popular choice as a teaching language).
Code Readability
When I write a to-do list on a piece of paper, it looks something like this:
Shopping Fix broken gutter Mow the lawn
This is an obvious list of items. If I wanted to break down my to-do list a bit further, I might write something like this:
Shopping: Eggs Bacon Tomatoes Fix broken gutter: Borrow ladder from next door Find hammer and nails Return ladder! Mow the lawn: Check lawn around pond for frogs Check mower fuel level
Intuitively we understand that the main tasks are broken down into sub-tasks that are indented underneath the main task to which they relate. This makes it easy to see, at a glance, how the tasks relate to each other.
This is called scoping.
Indenting in this manner is also how Python organizes the various tasks defined in Python programs. For example, the following code simply says that there is a function called say_hello that asks the user to input their name, and then — you guessed it — prints a friendly greeting:
def say_hello(): name = input('What is your name? ') print('Hello, ' + name)
Here’s this code in action (including my user input):
What is your name? Nicholas Hello, Nicholas
Notice how the lines of code implementing the say_hello function are indented just like the to-do list. Furthermore, each instruction in the code is on its own line. The code is easy to read and understand: it is obvious which lines of code relate to each other just by looking at the way the code is indented.
Most other computer languages use syntactic symbols rather than indentation to indicate scope. For example, many languages such as Java, JavaScript and C use curly braces and semicolons for this purpose.
Why is this important?
If, like me, you have taught students with English as an additional language or who have a special educational need such as dyslexia, then you will realize that Python’s intuitive indentation is something people the world over understand (no matter their linguistic background). A lack of confusing symbols such as '{', '}' and ';' scattered around the code also make it a lot easier to read Python code. Such indentation rules also guide how the code should look when you write it down — the students intuitively understand how to present their work.
Compared to most other languages, Python’s syntax (how it is written) is simple and easy to understand. For example, the following code written using the Perl programming language will look for duplicate words in a text document:
print "$.: doubled $_\n" while /\b(\w+)\b\s+\b\1\b/gi
Can you work out how Perl does this?
(In Perl’s defense, it is an amazingly powerful programming language with a different set of aims and objectives than Python.
Download
Python in Education by Nicholas H. Tollervey.epub
Python in Education by Nicholas H. Tollervey.pdf
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Eco-friendly approach of bio-indigo synthesis and developing purification methods towards isolation of indigo from indirubin and bacterial fragments by Ramalingam Manivannan & Kaliyan Prabakaran & Young-A Son(149437)
Whisky: Malt Whiskies of Scotland (Collins Little Books) by dominic roskrow(74269)
CONSORT 2025 statement: updated guideline for reporting randomized trials by unknow(66072)
Critical evaluation of the ProfiLER-02 study design and outcomes by Vivek Subbiah & Razelle Kurzrock(65822)
Cardiac gene therapy makes a comeback by Oliver J. Müller & Susanne Hille & Anca Kliesow Remes(65257)
Unveiling the design rules for tunable emission in graphene quantum dots: A high-throughput TDDFT and machine learning perspective by Şener Özönder & Mustafa Coşkun Özdemir & Caner Ünlü(50857)
A yeast-based oral therapeutic delivers immune checkpoint inhibitors to reduce intestinal tumor burden by unknow(33061)
Covalent hitchhikers guide proteins to the nucleus by Alexander F. Russell & Madeline F. Currie & Champak Chatterjee(32949)
Meet the Authors: Christopher R. Mansfield and Emily R. Derbyshire by Christopher R. Mansfield & Emily R. Derbyshire(32708)
What's Done in Darkness by Kayla Perrin(27102)
Topological analysis of non-conjugated ethylene oxide cored dendrimers decorated with tetraphenylethylene: Insights from degree-based descriptors using the polynomial approach by A Theertha Nair & D Antony Xavier & Annmaria Baby & S Akhila(26482)
Investigation of mechanical and self-healing properties of hydroxyl-terminated polybutadiene functionalized with 2-ureido-4-pyrimidinone by Mohsen Kazazi & Mehran Hayaty & Ali Mousaviazar(26435)
The Ultimate Python Exercise Book: 700 Practical Exercises for Beginners with Quiz Questions by Copy(21011)
De Souza H. Master the Age of Artificial Intelligences. The Basic Guide...2024 by Unknown(20773)
D:\Jan\FTP\HOL\Work\Alien Breed - Tower Assault CD32 Alien Breed II - The Horror Continues Manual 1.jpg by PDFCreator(20647)
The Fifty Shades Trilogy & Grey by E L James(19604)
Shot Through the Heart: DI Grace Fisher 2 by Isabelle Grey(19486)
Shot Through the Heart by Mercy Celeste(19345)
Wolf & Parchment: New Theory Spice & Wolf, Vol. 10 by Isuna Hasekura and Jyuu Ayakura(17490)